home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
bbs
/
igmkit10.zip
/
SRC_CODE.ZIP
/
SKELETON.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-06-20
|
8KB
|
337 lines
{
This file is intended to be used to create IGM's for Hackers: the Role
Playing Game using the Door Driver called DDPlus, and Turbo Pascal 7.0.
Talon Software does not insure that this source code will work, and
we do not insure that it will correctly work on any other door driver.
You may modify this source as you please.. But give credits to Talon
Software in your documentation.. Thank you.
All we ask from using this Skeleton, is to inform us about your IGMs
creation, and we will add it to our IGM list for future IGMKits..
One little note.. When ever it says something about GAME it means
Hackers: the Role Playing Game, not the IGM you are making..
Talon Software
}
program TalonSoftware_IGM_Skeleton;
uses DDPlus, CRT;
type
IGMData=Record {This is the data that is to be put on the IGM's}
UserFN: string[30]; { player file. You may add more to it, but these}
UserLN: string[30]; { two lines are required if you are going to use }
end; { this skeleton.}
PwrdStr=string[13];
ifno = record {This is the Game's Player info..}
UserFN: string[30]; {DO NOT MODIFY THE ORDER OF THE}
UserLN: string[30]; {VARIABLES OR THE IGM *WILL* CORRUPT}
Handle: array[1..20] of char; {THE PLAYER.DAT FILE FOR THE GAME!!}
Gang: integer; {You may change the names of the variables}
Feds: integer; {though. }
Level: integer;
Exper: integer;
Money: single;
Actions: integer;
CPU: integer;
RAM: integer;
OS: integer;
MaxHD: single;
HD: single;
Modem: longint;
Mother: integer;
Security: integer;
Groups: integer;
Cracker: integer;
WarDialer: Boolean;
RedBox: Boolean;
BeigeBox: Boolean;
AquaBox: Boolean;
Password1:PwrdStr;
PwLeng1: integer;
Password2: PwrdStr;
PwLeng2: integer;
Password3: PwrdStr;
PwLeng3: integer;
ISP: single;
Phone: single;
Jailed: Boolean;
JailDays: integer;
NoPayDays: Integer;
SellInfo: longint;
Servers: array[1..45] of integer;
Plans: array [1..3] of boolean;
Parts: array[1..12] of Boolean;
Files: array [1..1000] of single;
Talked: Boolean;
CPUSpeed: integer;
Already: array[1..10] of integer;
GroupN: string[20];
{Internal Variables}
Deleted: Boolean;
PlayedToday: Boolean;
HandLen: integer;
Online: Boolean;
DaysPlayed: integer;
end;
GFile= File of Ifno;
IFile= File of IGMData;
var IGMDirectory, GameDirectory: string;
Game: ifno;
IGM: IGMData;
IGMF: Ifile;
GameF: GFile;
IGMNum, GameNum: integer;
const GameData='PLAYER.DAT'; {This is the name of the Hacker's player info
file, do not modify}
PlayData='IGM.DAT'; {This is the name of the IGM's player info, this
you can modify}
function Exist(FileName: String): Boolean; {This function will return TRUE
or FALSE depending on if the
specified file exists}
var
F: file;
begin
{$I-}
Assign(F, FileName);
Reset(F);
Close(F);
{$I+}
Exist := (IOResult = 0) and (FileName <> '');
end;
procedure Nl (times:integer); {Sends TIMES line feeds}
var Tm:integer;
begin
for Tm:=1 to Times do
swriteln('');
end;
function Center(Cntr: string): string; {An unorgranized function that returns
a centered string from the string that
it recieves}
var LongInte,TM: integer;
Longreal: real;
begin
LongInte:=length(Cntr);
if LongInte Mod 2 <> 0 then
LongInte:=LongInte+1;
LongReal:=80-LongInte;
LongReal:=LongReal/2;
for Tm:=1 to 80 do
begin
Cntr:=' ' + Cntr;
if Tm>=LongReal+1 then
begin
Tm:=80;
end;
end;
Center:=Cntr;
end;
procedure Pause; {Generic Pause Command}
var PauseChar: char;
begin
Set_Color(14,0);
SWriteln(CENTER('PRESS ANY KEY TO CONTINUE'));
SRead_Char(PauseChar);
end;
procedure FileGame; {File Locking Procedure for the GAME Player DATA}
var GoAhead: Boolean;
OpenAttempts:Byte;
begin
assign(GameF,GameDirectory+GameData);
OpenAttempts:=1;
Repeat
{$I-}
Reset(GameF); {opens the file}
{$I+};
GoAhead:= (IOResult = 0);
If Not GoAhead then OpenAttempts :=OpenAttempts+1;
Until (GoAhead) or (OpenAttempts>1000);
end;
procedure FileIGM; {File Locking Procedure for the IGM Player DATA}
var GoAhead: Boolean;
OpenAttempts:Byte;
begin
assign(IGMF,IGMDirectory+PlayData);
OpenAttempts:=1;
Repeat
{$I-}
Reset(IGMF); {opens the file}
{$I+};
GoAhead:= (IOResult = 0);
If Not GoAhead then OpenAttempts :=OpenAttempts+1;
Until (GoAhead) or (OpenAttempts>1000);
end;
function LoadConfig: Boolean;
var FileVar: text;
Good: Boolean;
begin
{This function will read the info off of the Config file.. If the file
exists it will return TRUE, if it doesn't exist it will return FALSE}
assign(FileVar, 'CONFIG.CFG'); {Replase CONFIG.CFG with your Config File
Files name}
Good:=True;
if Exist('CONFIG.CFG') then {Will check to see if CONFIG.CFG is in the
current directory}
reset(FileVar)
else
begin
SClrSCr;
Set_Color(12,0);
NL(4);
SWRiteln(CENTER('YOUR SYSOP DOES NOT HAVE THIS IGM'));
SWRiteln(CENTER('SETUP CORRECTLY, PLEASE ASK YOUR'));
SWRiteln(CENTER('SYSOP TO FIX IT.'));
Good:=False;
Nl(4);
Pause;
exit;
end;
Readln(FileVar, GameDirectory); {These two lines should be the first two}
Readln(FileVar, IGMDirectory); {Lines of all IGM Config files.. They simply
tell the location of the IGM and the Game
for use by the IGM.. This skeleton of an
IGM will NOT work without them.}
SclrScr;
Close(FileVar);
LoadConfig:=Good;
end;
procedure LoadIGM;
var Num: integer;
begin
{THIS Procedure will load the Game Player data, and IGM Player Data
for the IGM to use and modify, but it will not put it back onto
the file when the IGM is finished, that is your job.}
assign(IGMF, IGMDirectory+'IGM.DAT');
if Not Exist(IGMDirectory+'IGM.DAT') then
begin
rewrite(IGMF);
close(IGMF);
end;
FileGame;
FileIGM;
Num:=0;
GameNum:=0;
repeat
Num:=Num+1;
if Eof(GameF) then break;
Read(GameF, Game);
if Game.UserFN=USER_FIRST_NAME then
if Game.UserLN=USER_LAST_NAME then
begin
GameNum:=Num;
break;
end;
until EOF(GameF);
if GameNum=0 then GameNum:=FileSize(GameF);
Close(GameF);
Num:=0;
IGMNum:=0;
repeat
if Eof(IGMF) then break;
Read(IGMF, IGM);
Num:=Num+1;
if (IGM.UserFN=USER_FIRST_NAME) and (IGM.UserLN=USER_LAST_NAME) then
begin
IGMNum:=Num;
break;
end;
until EOF(IGMF);
if IGMNum=0 then
begin
IGMnum:=FileSize(IGMF);
Seek(IGMF, IGMNum);
IGM.UserFN:=USER_First_Name;
IGM.UserLN:=User_Last_Name;
Write(IGMF, IGM);
end;
close(IGMF);
end;
procedure StartIGM;
begin
{BEGINING OF IGM}
end;
procedure RunMaint;
begin
{PUT YOUR MAINTENANCE CODE HERE}
end;
begin {MAIN}
initdoordriver('DOOR.CTL'); {Default CTL file required to run the game}
ProgName:='IGM NAME'; {Put your IGM Name here for the status bar}
Randomize;
AnsiOn:=True; {Forces caller into ANSI}
if LoadConfig=True then {If the configuration loaded successfully then go on}
begin
LoadIGM; {Gets GAME Player #, and IGM Player #}
RunMaint; {Runs Maintenance if required}
StartIGM; {Goes to first part of IGM, for displaying rules etc..}
end
else
exit;
end.
{Thats it.. We hope this helps you create the IGM of your dreams}